const http = require('http')
const sleep = (time = 0) => {
    const targetTime = (new Date().getTime()) + (time * 1000)
    console.log(new Date().getTime(), targetTime)
    while (new Date().getTime() < targetTime) {

    }
}
sleep(4)
const server = http.createServer((req, res) => {
    res.setHeader('content-type', 'text/html;charset=utf-8')
    res.end('csdavcdsvv')
})
server.listen(8080, () => {
    console.log('服务启动了....')
})